package com.wxy.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxy.domain.BorrowRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

/**
 * @author 47868
 */
@Mapper
@Component("BorrowRecordDao")
public interface BorrowRecordDao extends BaseMapper<BorrowRecord> {
    /**
     *还书后更新订单状态
     * @param returnTime 更新还书时间
     * @param id 借书的订单号
     */
    @Update("update borrow_record set status='已还',return_date=#{returnTime} where id=#{id}")
    void updateStatus(@Param("returnTime") String returnTime,@Param("id") String id);
}
